home *** CD-ROM | disk | FTP | other *** search
/ Champak 106 / Vol 106.iso / games / how_to_m.swf / scripts / DefineSprite_1032 / frame_1 / DoAction.as
Encoding:
Text File  |  2010-04-12  |  14.9 KB  |  739 lines

  1. function cinnamons()
  2. {
  3.    cinnamon.onPress = function()
  4.    {
  5.       ins2._visible = false;
  6.       this.swapDepths(depths);
  7.       startDrag(this,0);
  8.    };
  9.    cinnamon.onRelease = function()
  10.    {
  11.       if(bowl1Hit.hitTest(this))
  12.       {
  13.          stopDrag();
  14.          this._x = -164.7;
  15.          this._y = 111;
  16.          depths++;
  17.          this.gotoAndPlay(2);
  18.          this.enabled = false;
  19.          Nutmeg();
  20.       }
  21.    };
  22. }
  23. function saltdrag()
  24. {
  25.    salt.onPress = function()
  26.    {
  27.       ins25._visible = false;
  28.       this.startDrag();
  29.       this.swapDepths(depths++);
  30.    };
  31.    salt.onRelease = function()
  32.    {
  33.       if(this.hitTest(bowl1Hit))
  34.       {
  35.          this.stopDrag();
  36.          this.gotoAndPlay(2);
  37.          this._x = -375.1;
  38.          this._y = -137.8;
  39.          this.enabled = false;
  40.          spoon();
  41.       }
  42.    };
  43. }
  44. function ginger()
  45. {
  46.    ginerspoon.onPress = function()
  47.    {
  48.       ins4._visible = false;
  49.       this.startDrag();
  50.       this.swapDepths(depths++);
  51.    };
  52.    ginerspoon.onRelease = function()
  53.    {
  54.       if(ginerspoon.hitTest(bowl1Hit))
  55.       {
  56.          stopDrag();
  57.          this._x = -149.6;
  58.          this._y = 124.1;
  59.          this.gotoAndPlay(2);
  60.          this.enabled = false;
  61.          saltdrag();
  62.       }
  63.    };
  64. }
  65. function spoon()
  66. {
  67.    spoon1.onPress = function()
  68.    {
  69.       ins5._visible = false;
  70.       startDrag(this,0);
  71.       this.swapDepths(depths++);
  72.    };
  73.    spoon1.onRelease = function()
  74.    {
  75.       if(this.hitTest(bowl1Hit))
  76.       {
  77.          this._visible = false;
  78.          salt.gotoAndStop(26);
  79.          bakingsoda.gotoAndStop(24);
  80.          cinnamon.gotoAndStop(9);
  81.          nutSpoon.gotoAndStop(11);
  82.          ginerspoon.gotoAndStop(11);
  83.          bowl.mixing.gotoAndPlay(2);
  84.          vegetables();
  85.       }
  86.    };
  87. }
  88. function vegetables()
  89. {
  90.    vegetableoil.onPress = function()
  91.    {
  92.       ins6._visible = false;
  93.       this.startDrag();
  94.       this.swapDepths(depths++);
  95.    };
  96.    vegetableoil.onRelease = function()
  97.    {
  98.       if(this.hitTest(bowl2Hit))
  99.       {
  100.          stopDrag();
  101.          this.gotoAndPlay(2);
  102.          this.enabled = false;
  103.          this._x = 104.4;
  104.          this._y = 131;
  105.          sugar();
  106.       }
  107.    };
  108. }
  109. function sugar()
  110. {
  111.    sugarbox.onPress = function()
  112.    {
  113.       ins7._visible = false;
  114.       this.startDrag();
  115.       this.swapDepths(depths++);
  116.    };
  117.    sugarbox.onRelease = function()
  118.    {
  119.       if(this.hitTest(bowl2Hit))
  120.       {
  121.          this.stopDrag();
  122.          this.gotoAndPlay(2);
  123.          this._x = -93.4;
  124.          this._y = 188.6;
  125.          this.enabled = false;
  126.          beatenegg();
  127.       }
  128.    };
  129. }
  130. function beatenegg()
  131. {
  132.    egg.onPress = function()
  133.    {
  134.       this.startDrag();
  135.       this.swapDepths(depths++);
  136.    };
  137.    egg.onRelease = function()
  138.    {
  139.       if(this.hitTest(bowl2Hit))
  140.       {
  141.          ins8._visible = false;
  142.          this.stopDrag();
  143.          this.gotoAndPlay(2);
  144.          this.enabled = false;
  145.          this._x = -54.6;
  146.          this._y = 145.6;
  147.          essence();
  148.       }
  149.    };
  150. }
  151. function essence()
  152. {
  153.    vennila.onPress = function()
  154.    {
  155.       ins9._visible = false;
  156.       this.startDrag();
  157.       this.swapDepths(depths++);
  158.    };
  159.    vennila.onRelease = function()
  160.    {
  161.       if(this.hitTest(bowl2Hit))
  162.       {
  163.          this.stopDrag();
  164.          this.gotoAndPlay(2);
  165.          this.enabled = false;
  166.          this._x = -246;
  167.          this._y = 461.2;
  168.          dragbowl();
  169.       }
  170.    };
  171. }
  172. function dragbowl()
  173. {
  174.    bowl2.onPress = function()
  175.    {
  176.       ins10._visible = false;
  177.       bowlsample._visible = false;
  178.       vegetableoil.gotoAndStop(21);
  179.       sugarbox.gotoAndStop(19);
  180.       vennila.gotoAndStop(19);
  181.       egg.gotoAndStop(13);
  182.       this.startDrag();
  183.       this.swapDepths(depths++);
  184.    };
  185.    bowl2.onRelease = function()
  186.    {
  187.       if(this.hitTest(bowl1Hit))
  188.       {
  189.          stopDrag();
  190.          this.gotoAndPlay(2);
  191.          this._x = -180.5;
  192.          this._y = 110.7;
  193.          this.enabled = false;
  194.          pumkin();
  195.       }
  196.    };
  197. }
  198. function pumkin()
  199. {
  200.    cannedpumkin.onPress = function()
  201.    {
  202.       ins12._visible = false;
  203.       this.startDrag();
  204.       this.swapDepths(depths++);
  205.    };
  206.    cannedpumkin.onRelease = function()
  207.    {
  208.       if(this.hitTest(bowl2Hit))
  209.       {
  210.          stopDrag();
  211.          this._x = -148.9;
  212.          this._y = 166.8;
  213.          this.gotoAndPlay(2);
  214.          this.enabled = false;
  215.          spoon3._visible = true;
  216.       }
  217.    };
  218. }
  219. function spoondrag()
  220. {
  221.    spoon5.onPress = function()
  222.    {
  223.       ins28._visible = false;
  224.       this.startDrag();
  225.       this.swapDepths(depths++);
  226.    };
  227.    spoon5.onRelease = function()
  228.    {
  229.       if(this.hitTest(tempghee))
  230.       {
  231.          this._visible = false;
  232.          bowlsample._visible = false;
  233.          flourmix.gotoAndStop(10);
  234.          tempghee._visible = false;
  235.          ghee._visible = true;
  236.          ghee.gotoAndPlay(2);
  237.          lemon();
  238.       }
  239.    };
  240. }
  241. function lemon()
  242. {
  243.    lemonjuice.onPress = function()
  244.    {
  245.       ins34._visible = false;
  246.       this.startDrag();
  247.       this.swapDepths(depths++);
  248.    };
  249.    lemonjuice.onRelease = function()
  250.    {
  251.       if(this.hitTest(bowl2Hit))
  252.       {
  253.          stopDrag();
  254.          this.gotoAndPlay(2);
  255.          this._x = -301.7;
  256.          this._y = 176.2;
  257.          this.enabled = false;
  258.          yellowcolors();
  259.       }
  260.    };
  261. }
  262. function spoons()
  263. {
  264.    spoon6.onPress = function()
  265.    {
  266.       ins13._visible = false;
  267.       this.startDrag();
  268.       trace("hits:");
  269.       this.swapDepths(depths++);
  270.    };
  271.    spoon6.onRelease = function()
  272.    {
  273.       if(this.hitTest(bowl2Hit))
  274.       {
  275.          this.stopDrag();
  276.          this._visible = false;
  277.          ghee._visible = false;
  278.          tempghee._visible = true;
  279.          lemonjuice.gotoAndStop(14);
  280.          yellowcolor.gotoAndStop(26);
  281.          redcolor.gotoAndStop(22);
  282.          bowl5._visible = true;
  283.          bowl5.gotoAndPlay(2);
  284.          this.enabled = false;
  285.          knife1.enabled = true;
  286.       }
  287.    };
  288. }
  289. function yellowcolors()
  290. {
  291.    yellowcolor.onPress = function()
  292.    {
  293.       ins30._visible = false;
  294.       this.startDrag();
  295.       this.swapDepths(depths++);
  296.    };
  297.    yellowcolor.onRelease = function()
  298.    {
  299.       if(this.hitTest(bowl2Hit))
  300.       {
  301.          stopDrag();
  302.          this.gotoAndPlay(2);
  303.          this._x = 50.3;
  304.          this._y = -92.6;
  305.          this.enabled = false;
  306.          redcolors();
  307.       }
  308.    };
  309. }
  310. function redcolors()
  311. {
  312.    redcolor.onPress = function()
  313.    {
  314.       ins31._visible = false;
  315.       this.startDrag();
  316.       this.swapDepths(depths++);
  317.    };
  318.    redcolor.onRelease = function()
  319.    {
  320.       if(this.hitTest(bowl2Hit))
  321.       {
  322.          stopDrag();
  323.          this.gotoAndPlay(2);
  324.          this._x = 17.6;
  325.          this._y = -97;
  326.          this.enabled = false;
  327.          spoons();
  328.       }
  329.    };
  330. }
  331. oven1._visible = false;
  332. stop();
  333. var depths = 10;
  334. bowlfull1._visible = false;
  335. finalcakes._visible = false;
  336. nutSpoon._visible = false;
  337. spoon2._visible = false;
  338. spoon3._visible = false;
  339. spoon5._visible = false;
  340. spoon6._visible = false;
  341. flourmix.enabled = false;
  342. knife.enabled = false;
  343. knife1.enabled = false;
  344. spoon4._visible = false;
  345. bowl2._visible = false;
  346. bowl5._visible = false;
  347. cookie._visible = false;
  348. var countval = 0;
  349. nuggets._visible = false;
  350. f1.enabled = false;
  351. f2.enabled = false;
  352. duplicatesoda._visible = false;
  353. s = 2;
  354. while(s <= 6)
  355. {
  356.    eval("bowlfull" + s)._visible = false;
  357.    s++;
  358. }
  359. nuggets._visible = false;
  360. ghee._visible = false;
  361. mixinganimation._visible = false;
  362. pumkinanimation._visible = false;
  363. spoonanimation._visible = false;
  364. allmix._visible = false;
  365. cookiesheet._visible = false;
  366. tray._visible = false;
  367. nuggetsanimation.enabled = false;
  368. pumkinanimation.swapDepths(800);
  369. m = 2;
  370. while(m <= 36)
  371. {
  372.    eval("ins" + m)._visible = false;
  373.    m++;
  374. }
  375. bakingsoda.onPress = function()
  376. {
  377.    ins1._visible = false;
  378.    this.swapDepths(depths);
  379.    startDrag(this,0);
  380. };
  381. bakingsoda.onRelease = function()
  382. {
  383.    if(bowl1Hit.hitTest(this))
  384.    {
  385.       stopDrag();
  386.       this._x = -205;
  387.       this._y = 110;
  388.       depths++;
  389.       this.gotoAndPlay(2);
  390.       this.enabled = false;
  391.       cinnamons();
  392.    }
  393. };
  394. Nutmeg = function()
  395. {
  396.    nutmeg.onPress = function()
  397.    {
  398.       ins3._visible = false;
  399.       this._x = -140.2;
  400.       this._y = -70.6;
  401.       nutSpoon._visible = true;
  402.       NutSpoon();
  403.    };
  404. };
  405. NutSpoon = function()
  406. {
  407.    nutSpoon.onPress = function()
  408.    {
  409.       startDrag(this,0);
  410.       this.swapDepths(depths);
  411.    };
  412.    nutSpoon.onRelease = function()
  413.    {
  414.       if(bowl1Hit.hitTest(this))
  415.       {
  416.          stopDrag();
  417.          this._x = -149.6;
  418.          this._y = 124.1;
  419.          depths++;
  420.          this.gotoAndPlay(2);
  421.          this.enabled = false;
  422.          ginger();
  423.       }
  424.    };
  425. };
  426. tray.onPress = function()
  427. {
  428.    this.startDrag();
  429.    if(this.hitTest(oven))
  430.    {
  431.       oven.gotoAndPlay(2);
  432.       this._visible = false;
  433.    }
  434. };
  435. spoon2.onPress = function()
  436. {
  437.    ins11._visible = false;
  438.    this.startDrag();
  439.    this.swapDepths(depths++);
  440. };
  441. spoon2.onRelease = function()
  442. {
  443.    if(this.hitTest(bowl1Hit))
  444.    {
  445.       spoon2._visible = false;
  446.       bowl2.gotoAndStop(13);
  447.       spoonanimation._visible = true;
  448.       spoonanimation.gotoAndPlay(2);
  449.    }
  450. };
  451. spoon3.onPress = function()
  452. {
  453.    ins13._visible = false;
  454.    this.startDrag();
  455.    this.swapDepths(depths++);
  456. };
  457. spoon3.onRelease = function()
  458. {
  459.    if(this.hitTest(bowl2Hit))
  460.    {
  461.       this._visible = false;
  462.       pumkinanimation._visible = true;
  463.       pumkinanimation.gotoAndPlay(2);
  464.    }
  465. };
  466. mixinganimation.onPress = function()
  467. {
  468.    ins14._visible = false;
  469.    this.startDrag();
  470.    this.swapDepths(depths++);
  471. };
  472. mixinganimation.onRelease = function()
  473. {
  474.    if(this.hitTest(bowl1Hit))
  475.    {
  476.       stopDrag();
  477.       this.gotoAndPlay(2);
  478.       this.enabled = false;
  479.       this._x = -9.1;
  480.       this._y = -67.8;
  481.    }
  482. };
  483. spoon4.onPress = function()
  484. {
  485.    ins15._visible = false;
  486.    this.startDrag();
  487.    this.swapDepths(depths++);
  488. };
  489. spoon4.onRelease = function()
  490. {
  491.    if(this.hitTest(bowl1Hit))
  492.    {
  493.       stopDrag();
  494.       allmix._visible = true;
  495.       gingerspoon.gotoAndStop(12);
  496.       allmix.gotoAndPlay(2);
  497.       this._visible = false;
  498.    }
  499. };
  500. knife.onPress = function()
  501. {
  502.    cookiesheet.enabled = true;
  503.    ins23._visible = false;
  504.    this.startDrag();
  505.    this.swapDepths(depths++);
  506.    if(this.hitTest(cookiesheet))
  507.    {
  508.       stopDrag();
  509.       this.gotoAndPlay(2);
  510.       this._x = -411;
  511.       this._y = -96.2;
  512.       this.enabled = false;
  513.    }
  514. };
  515. bowlfull1.onPress = function()
  516. {
  517.    ins16._visible = false;
  518.    this.startDrag();
  519.    allmix._visible = false;
  520.    bowl._visible = false;
  521.    this.swapDepths(depths++);
  522. };
  523. bowlfull1.onRelease = function()
  524. {
  525.    if(this.hitTest(hit1))
  526.    {
  527.       this.stopDrag();
  528.       this._x = -21.1;
  529.       this._y = 189.7;
  530.       this.gotoAndPlay(2);
  531.       this.enabled = false;
  532.    }
  533. };
  534. bowlfull2.onPress = function()
  535. {
  536.    ins16._visible = false;
  537.    this.startDrag();
  538.    allmix._visible = false;
  539.    bowl._visible = false;
  540.    this.swapDepths(depths++);
  541. };
  542. bowlfull2.onRelease = function()
  543. {
  544.    if(this.hitTest(hit2))
  545.    {
  546.       this.stopDrag();
  547.       this._x = -21.1;
  548.       this._y = 189.7;
  549.       this.gotoAndPlay(2);
  550.       this.enabled = false;
  551.    }
  552. };
  553. bowlfull3.onPress = function()
  554. {
  555.    ins16._visible = false;
  556.    this.startDrag();
  557.    allmix._visible = false;
  558.    bowl._visible = false;
  559.    this.swapDepths(depths++);
  560. };
  561. bowlfull3.onRelease = function()
  562. {
  563.    if(this.hitTest(hit3))
  564.    {
  565.       this.stopDrag();
  566.       this._x = -21.1;
  567.       this._y = 189.7;
  568.       this.gotoAndPlay(2);
  569.       this.enabled = false;
  570.    }
  571. };
  572. bowlfull4.onPress = function()
  573. {
  574.    ins16._visible = false;
  575.    this.startDrag();
  576.    allmix._visible = false;
  577.    bowl._visible = false;
  578.    this.swapDepths(depths++);
  579. };
  580. bowlfull4.onRelease = function()
  581. {
  582.    if(this.hitTest(hit4))
  583.    {
  584.       this.stopDrag();
  585.       this._x = -21.1;
  586.       this._y = 189.7;
  587.       this.gotoAndPlay(2);
  588.       this.enabled = false;
  589.    }
  590. };
  591. bowlfull4.onRelease = function()
  592. {
  593.    if(this.hitTest(hit4))
  594.    {
  595.       this.stopDrag();
  596.       this._x = -21.1;
  597.       this._y = 189.7;
  598.       this.gotoAndPlay(2);
  599.       this.enabled = false;
  600.    }
  601. };
  602. bowlfull5.onPress = function()
  603. {
  604.    ins16._visible = false;
  605.    this.startDrag();
  606.    allmix._visible = false;
  607.    bowl._visible = false;
  608.    this.swapDepths(depths++);
  609. };
  610. bowlfull5.onRelease = function()
  611. {
  612.    if(this.hitTest(hit5))
  613.    {
  614.       this.stopDrag();
  615.       this._x = -21.1;
  616.       this._y = 189.7;
  617.       this.gotoAndPlay(2);
  618.       this.enabled = false;
  619.    }
  620. };
  621. bowlfull6.onPress = function()
  622. {
  623.    ins16._visible = false;
  624.    this.startDrag();
  625.    allmix._visible = false;
  626.    bowl._visible = false;
  627.    this.swapDepths(depths++);
  628. };
  629. bowlfull6.onRelease = function()
  630. {
  631.    if(this.hitTest(hit6))
  632.    {
  633.       this.stopDrag();
  634.       this._x = -21.1;
  635.       this._y = 189.7;
  636.       this.gotoAndPlay(2);
  637.       this.enabled = false;
  638.    }
  639. };
  640. flourmix.onPress = function()
  641. {
  642.    ins20._visible = false;
  643.    this.startDrag();
  644.    this.swapDepths(depths++);
  645. };
  646. flourmix.onRelease = function()
  647. {
  648.    if(this.hitTest(bowlsample))
  649.    {
  650.       this.gotoAndPlay(2);
  651.       this.stopDrag();
  652.       this._x = -247.8;
  653.       this._y = 178.7;
  654.       this.enabled = false;
  655.       spoondrag();
  656.    }
  657. };
  658. cookiesheet.onPress = function()
  659. {
  660.    ins24._visible = false;
  661.    this.startDrag();
  662.    this.swapDepths(depths++);
  663.    if(this.hitTest(oven1))
  664.    {
  665.       oven1.gotoAndPlay(2);
  666.       this._visible = false;
  667.    }
  668. };
  669. knife1.onPress = function()
  670. {
  671.    ins29._visible = false;
  672.    this.startDrag();
  673.    this.swapDepths(depths++);
  674. };
  675. knife1.onRelease = function()
  676. {
  677.    if(this.hitTest(bowl2Hit))
  678.    {
  679.       this.stopDrag();
  680.       this._visible = false;
  681.       finalcakes.gotoAndPlay(2);
  682.    }
  683. };
  684. nuggetsanimation.onPress = function()
  685. {
  686.    ins35._visible = false;
  687.    this.gotoAndStop(2);
  688.    nuggets._visible = true;
  689. };
  690. nuggets.onPress = function()
  691. {
  692.    this.startDrag();
  693.    this.swapDepths(1060);
  694.    if(this.hitTest(hit))
  695.    {
  696.       stopDrag();
  697.       this.gotoAndPlay(2);
  698.       this.enabled = false;
  699.       this._x = -53.8;
  700.       this._y = 71.6;
  701.    }
  702. };
  703. f1.onPress = function()
  704. {
  705.    ins33._visible = false;
  706.    this.swapDepths(1065);
  707.    this.startDrag();
  708. };
  709. f1.onRelease = function()
  710. {
  711.    stopDrag();
  712.    if(this.hitTest(hit) || this.hitTest(bowlfruit))
  713.    {
  714.       trace("hit");
  715.       stopDrag();
  716.       ins33._visible = true;
  717.       f2.enabled = true;
  718.       finalcakes.enabled = true;
  719.    }
  720. };
  721. f2.onPress = function()
  722. {
  723.    ins33._visible = false;
  724.    f2.swapDepths(1062);
  725.    this.startDrag();
  726. };
  727. f2.onRelease = function()
  728. {
  729.    stopDrag();
  730.    if(this.hitTest(hit) || this.hitTest(bowlfruit))
  731.    {
  732.       countval++;
  733.       stopDrag();
  734.       finalcakes.enabled = true;
  735.       ins36._visible = true;
  736.       ins36.swapDepths(1300);
  737.    }
  738. };
  739.